// file: MotTest.cpp
#include "MotTest.hpp"

CPPUNIT_TEST_SUITE_REGISTRATION (MotTest);

void MotTest :: setUp(void){
	// set up test environment (initializing objects)
	a = new Mot();
	a->init(0,0,7,false,"");
	b = new Mot();
	b->init(0,0,5,true,"");
}

void MotTest :: tearDown(void){
	// finally delete objects
    delete a;
    delete b;
}





void MotTest :: contientTest(void){
	CPPUNIT_ASSERT(a->contient(0,0)!=0);// On teste une case appartenant au mot
	CPPUNIT_ASSERT(b->contient(0,0)!=0);
	
	CPPUNIT_ASSERT(a->contient(1,0)==0);// On teste une case n'appartenant pas au mot
	CPPUNIT_ASSERT(b->contient(0,1)==0);
}

void MotTest :: initTest(void){
	CPPUNIT_ASSERT(a->getLigne()==0);
	CPPUNIT_ASSERT(a->getColonne()==0);
	CPPUNIT_ASSERT(a->getNbLettres()==7);
	CPPUNIT_ASSERT(a->getVertical()==false);
}

void MotTest :: estRempliTest(void){
	CPPUNIT_ASSERT(a->estRempli()==false);// On teste un mot vide
	a->setNbCasesRemplies(3);
	CPPUNIT_ASSERT(a->estRempli()==false);// On teste un mot non rempli
	a->setNbCasesRemplies(7);
	CPPUNIT_ASSERT(a->estRempli()==true);// On test un mot rempli
}
